<?php
namespace Client\Table;

use Zend\Db\Sql\Select;
use Zend\Paginator\Adapter\DbSelect;

use Zend\Paginator\Paginator;
use Zend\Db\Sql\Where;
use Zend\Db\ResultSet\ResultSet;

class TypeTable extends CommonTable
{
    protected $table = 'hy_type';
    protected $id = 'type_id';
    
    public function getAll(){
    	$select = new Select();
    	$select ->from($this->getTable())
    	->columns(array('type_id', 'type_thumb_image', 'type_link', 'type_name'))
    	->order('type_id DESC');
    	$rowset = $this->selectWith($select);
    	$result = $rowset->toArray();
    	return $result;

    }
    
    public function find($limit = 0, $paginated = false) {
        
        //$select = $this->sql->select();
        $select = new Select();
        $select ->from($this->getTable())
        ->columns(array('type_id', 'type_thumb_image', 'type_link', 'type_name'))
        ->order('type_id DESC');
        $rowset = $this->selectWith($select);
        //return $rowset->getDataSource();
        $result = $rowset->toArray();
        return $result;
    }
    
    public function findOne($cate_id = 1) {
    
        
    }
    

 
}